package cn.cj.erp.bo.system;

import cn.cj.erp.common.SearchParam;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.ArrayList;
import java.util.List;

/**
 * 角色与菜单对应关系
 *
 * @author chenjian
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class SysRoleMenuBo extends SearchParam {
    /** 角色ID */
    private Long roleId;

    /** 菜单ID */
    private Long menuId;

    public static List<SysRoleMenuBo> newList(Long roleId, List<Long> menuIds) {
        List<SysRoleMenuBo> list = new ArrayList<>();
        for (Long menuId : menuIds) {
            SysRoleMenuBo bo = new SysRoleMenuBo();
            bo.setMenuId(menuId);
            bo.setRoleId(roleId);
            list.add(bo);
        }
        return list;
    }
}
